<?php
namespace Android\Controller;
use Think\Controller;
class userController extends Controller
{
    //返回个人信息
   public  function myinfo(){
        $user= D('user');
        $user_id = $_POST['user_id'];
        $info= $user->myinfo($user_id);
        echo json_encode($info);
    }
    //个人信息修改
    public function myinfoChange(){
        $user= D('user');
        $user_id = $_POST['user_id'];
        $success= $user->myinfoChange($user_id);
        if($success){
            echo "success";
        }else{
            echo "false";
        }
    }
    //返回粉丝数关注数好友数
    public function maininfo()
    {
        $user = D('user');
        $user_id = $_POST['user_id'];
        $info = $user->userdetails($user_id);
        echo json_encode($info);
    }
    //返回粉丝的列表页面
    public function fanslist()
    {
        $user_id = $_POST['user_id'];
        $user = D('user');
        $info = $user->fanslist($user_id);
        echo json_encode($info);
    }
    //好友列表页面
    public function friendlist()
    {
        $user_id = $_POST['user_id'];
        $user = D('user');
        $info = $user->friendlist($user_id);
        echo json_encode($info);
    }
    //我的会员卡
    public function Mycard(){
        $user_id = $_POST['user_id'];
        $user = D('Card');
        $info = $user->Mycard($user_id);
        echo json_encode($info);
    }
    //查看发布的文章和动态
    public function  Mypub(){
        $article=  D(article);
        $user_id = $_GET['user_id'];
        $info= $article->mypub($user_id);
        echo json_encode($info);
    }

    //查看参加的活动和发布的活动
    public function  Myact(){
        $activity= D('activity');
        $user_id = $_POST['user_id'];
        $info=$activity->Myact($user_id);
        echo json_encode($info);
    }



}